<style>
    .upload-image {
        background: url('__CDN__/assets/img/plus.png') no-repeat center center;
        background-size: 30px 30px;
        height: 30px;
        width: 30px;
        border: 1px solid #ccc;
    }
</style>
<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Factory_id')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-factory_id" data-rule="required" data-source="clothbank/index" class="form-control selectpage" type="text" value="{$row.factory_id|htmlentities}" disabled>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">采购单据凭证:</label>
        <div class="col-xs-12 col-sm-8">            
            <ul class="row list-inline faupload-preview" id="p-images" data-listidx="0">
			   {volist name="purchase_certs" id="vo"}
			   <li class="col-xs-3"><a href="{$vo}" data-url="{$vo}" target="_blank" class="thumbnail"><img src="{$vo}" onerror="this.src='/cOSbyBVxpg.php/ajax/icon?suffix=png';this.onerror=null;" class="img-responsive" /></a></li>
			   {/volist}
			</ul>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-5 col-sm-2">裁床底单:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group">
                <input id="c-image" class="form-control" size="50" name="row[image]" type="text" value="{$row.image|htmlentities}">
                <div class="input-group-addon no-border no-padding">
                    <span><button type="button" id="faupload-image" class="btn btn-danger faupload" data-input-id="c-image" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="false" data-preview-id="p-image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                    <span><button type="button" id="fachoose-image" class="btn btn-primary fachoose" data-input-id="c-image" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
                </div>
                <span class="msg-box n-right" for="c-image"></span>
            </div>
            <ul class="row list-inline faupload-preview" id="p-image"></ul>
        </div>
    </div>
    <div class="form-group row" style="text-align:center;">
           <dl class="fieldlist" data-template="billtpl" data-name="row[bill]" id="bill">
               <dd class="th">
                   <ins>{:__('生产款号')}</ins>
                   <ins>{:__('布行')}</ins>
                   <ins>{:__('颜色')}</ins>
                   <ins>{:__('布匹批次')}</ins>
                   <ins>{:__('布匹数')}</ins>
                   <ins>{:__('裁床单')}</ins>
                   <ins>{:__('裁床数')}</ins>
                   <ins>{:__('备注')}</ins>
                   <ins>{:__('操作')}</ins>
               </dd>
               <!-- <dd>
               <ins><a href="javascript:;" class="btn btn-sm btn-success btn-append"><i class="fa fa-plus"></i> {:__('Append')}</a></ins>
               </dd> -->
               <hr>
               <dd style="display: none;"><a href="javascript:;" class="btn btn-sm btn-success btn-append"><i class="fa fa-plus"></i> {:__('Append')}</a></dd>
               <!--请注意 dd和textarea间不能存在其它任何元素，实际开发中textarea应该添加个hidden进行隐藏-->
               <textarea name="row[bill]" class="form-control" cols="30" rows="5" style="display: none;">{$jsonBill}</textarea>
           </dl>
           <script id="billtpl" type="text/html">
              <dd class="form-inline" style="text-align:center;">
                <ins><input name="<%=name%>[<%=index%>][clothtype_id]" class="form-control selectpage" type="text" data-rule="required" value="<%=row.clothtype_id%>" data-source="clothtype" data-field="No"></ins>
                <ins><input class="form-control selectpage" type="text" data-rule="required" value="<%=row.purchase.clothbank_id%>" data-source="clothbank" disabled></ins>
                <ins><input class="form-control" type="text" data-rule="required" value="<%=row.color%>" readonly></ins>
				<ins><input class="form-control sn" type="number" data-id="<%=row.purchase.id%>" title="采购单 : <%=row.purchase.sn%>" data-sn="<%=row.purchase.sn%>" value="<%=row.purchase.sn%>" readonly style="cursor: pointer;"></ins>
				<ins><input class="form-control" type="text" value="<%=row.used_nums%>" disabled></ins>
				<ins><input name="<%=name%>[<%=index%>][sn]" class="form-control" type="number" data-rule="required" value="<%=row.sn%>"></ins>
				<ins><input name="<%=name%>[<%=index%>][goods_nums]" class="form-control" type="number" data-rule="required" value="<%=row.goods_nums%>"></ins>
				<ins><input name="<%=name%>[<%=index%>][produce_ratio]" class="form-control" type="text" value="<%=row.produce_ratio%>"></ins>
				<ins>				
					<!--下面的两个按钮务必保留-->
                	<span class="btn btn-sm btn-danger btn-remove"><i class="fa fa-times"></i></span>
                	<span class="btn btn-sm btn-primary btn-dragsort"><i class="fa fa-arrows"></i></span>
					<input name="<%=name%>[<%=index%>][id]" class="form-control" type="hidden" value="<%=row.id%>">
				</ins>
			  </dd>
           </script>      
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Remark')}:</label>
        <div class="col-xs-12 col-sm-8">
            <textarea id="c-remark" class="form-control" rows="3" name="row[remark]" cols="50">{$row.remark|htmlentities}</textarea>
        </div>
    </div>
    
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
        	<input id="c-is_cut" type="hidden" name="row[is_cut]" value="1" readonly>
            <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
        </div>
    </div>
</form>
